package com.fengyong.web.controller.tool;

import com.fengyong.common.core.domain.AjaxResult;
import com.fengyong.common.enums.AiTool;
import com.fengyong.common.response.AiToolResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 公共工具类
 * @Version: 1.0
 */
@RestController
@RequestMapping("/public/tool")
public class PublicToolController {

    /**
     * 查询所有工具
     *
     * @return
     */
    @GetMapping("/list")
    public AjaxResult<List<AiToolResponse>> list() {
        List<AiToolResponse> aiToolList = new ArrayList<>();
        for (AiTool value : AiTool.values()) {
            AiToolResponse aiToolResponse = new AiToolResponse(value.getCode(), value.getDescription());
            aiToolList.add(aiToolResponse);
        }
        return AjaxResult.success(aiToolList);
    }
}
